package org.example.thread;

public class MyRunable implements Runnable{
    @Override
    public void run() {
        for(int i=1;i<100;i++){
            System.out.println(i);
        }
    }

    public static void main(String[] args) {
//        Runnable runnable = new MyRunable();
//        Thread t = new Thread(runnable);
//        t.start();


//        Thread thread = new Thread(new Runnable() {
//            @Override
//            public void run() {
//                for (int i = 1; i <= 10; i++) {
//                    System.out.println(i);
//                }
//            }
//        });
        Thread thread = new Thread(()->{
            for (int i = 1; i <= 5; i++) {
                    System.out.println(i);
                }
        });
        thread.start();
    }
}
